package com.example.peibei.ui.adapter;

import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dingtao.common.bean.HomeBannerCate;
import com.dingtao.common.bean.HomeCateTwo;
import com.example.peibei.R;

import java.util.List;

public class ChooseCateAdapter extends BaseQuickAdapter<HomeCateTwo.CategoryDTO, BaseViewHolder> {
    public ChooseCateAdapter(@Nullable List<HomeCateTwo.CategoryDTO> data) {
        super(R.layout.item_choose_cate, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeCateTwo.CategoryDTO item) {
        helper.setText(R.id.tv_title, item.getCaption()).setText(R.id.tv_remark,item.getRemarks());
        ImageView head = helper.getView(R.id.iv_choose);
        if (item.isChoosed()) {
            head.setVisibility(View.VISIBLE);
        } else {
            head.setVisibility(View.GONE);
        }
    }
}
